package com.java.mall_imooc.form;

import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author jiangli
 * @since 2020-03-15 20:55
 */
@Data
public class UserRegisterForm implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空") //判断字符串
//	@NotEmpty 判断集合
    private String username;
    /**
     * 用户密码
     */
    @NotBlank(message = "密码不能为空")
    private String password;
    /**
     *
     */
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;
    /**
     *
     */
    @NotBlank(message = "手机号码不能为空")
    @Pattern(regexp = "1[3|4|5|7|8][0-9]\\d{8}", message = "手机号码格式不正确")
    private String phone;
}
